package org;

/**
 * @Author: xwg
 * @CreateDate: 2021/11/19
 */


public class Multiple {
    /*
    *     Integer n = 11;
        for (int j = 1; j <= n; j++) {

            Integer first = j;
            for (int i = 1; i <= first; i++) {
                Integer result = first * i;
                System.out.print(first + "x" + i + "=" + result+" ");
            }
            System.out.println();
        }
    * */
//    属性 +方法 =》 对象 的骨架 就是类
    public static void main(String[] args) {
        Multiple multiple = new Multiple(8);
        multiple.printN();
    }

    //    属性
    private Integer n = 9;
//  构造函数 构造函数在 new关键字的过程中 自动运行
    public Multiple(Integer n) {
        this.n = n;
    }

    //    方法 = 函数
    public void printN() {
        for (int j = 1; j <= this.n; j++) {

            Integer first = j;
            for (int i = 1; i <= first; i++) {
                Integer result = first * i;
                System.out.print(first + "x" + i + "=" + result + " ");
            }
            System.out.println();
        }
    }

}
